<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;


class RolePrivilegePivotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('role_privilege_pivot', function (Blueprint $table) {
            $table->integer('role_id');
            $table->string('privilege_code');
            $table->unique(['role_id','privilege_code']);
        });
        \Illuminate\Support\Facades\DB::statement("alter table `role_privilege_pivot` comment '后台角色权限关联表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('role_privilege_pivot');
    }
}
